
<%@ page import="sige.Pagamento" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'pagamento.label', default: 'Pagamento')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<center>
        	<h1><g:message code="default.list.label" args="[entityName]" /></h1>
        </center>
        <ul class="breadcrumb">
          <li>
            <a class="home" href="${createLink(uri: '/')}">
              <i class="icon-home"></i>
              <g:message code="default.home.label"/>
            </a>
            <span class="divider"><g:message code="span.divider" /></span>
          </li>
          <li>
            <g:link class="create" action="create">
              <i class="icon-file"></i>
              <g:message code="default.new.label" args="[entityName]" />
            </g:link>
          </li>
        </ul>
        <g:if test="${flash.message}">
          <div class="alert alert-info">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            ${flash.message}
          </div>
        </g:if>
		<div id="list-pagamento" class="content scaffold-list" role="main">
			
            <div class="span8 offset3">
			    <span>${message(code: "MovimentacaoFinanceira.label", default: 'Movimentação' )}:</span>
                <g:link controller="${movimentacao.class.simpleName}" action="show" id="${movimentacao.id}">
                    <g:field type="text" name="movimentacao" readonly="readonly" 
                        value="${movimentacao?.descricao}" class="span6" />
                </g:link>
	            <table class="table table-striped table-hover">
                  <thead>
                    <tr>
                      <th><g:message code="pagamento.dataDeVencimento.label" default="Data De Vencimento" /> </th>

                      <th><g:message code="pagamento.valor.label" default="Valor" /> </th>

                      <th><g:message code="pagamento.caixaDiario.label" default="Caixa Diario" /></th>

                      <th> <g:message code="pagamento.total.label" default="Total" /> </th>
                      
                      <th><g:message code="pagamento.pago.label" default="Pago" /></th>
                    </tr>
                  </thead>
                  <tbody>
                  <g:each in="${ pagamentosList }" status="i" var="pagamentoInstance">
                    <tr>
                      <td>
                        <g:link action="show" id="${pagamentoInstance.id}">
                          <g:formatDate date="${pagamentoInstance.dataDeVencimento}" />
                        </g:link>
                      </td>

                      <td>${fieldValue(bean: pagamentoInstance, field: "valor")}</td>

                      <td>${fieldValue(bean: pagamentoInstance, field: "caixaDiario")}</td>

                      <td>${fieldValue(bean: pagamentoInstance, field: "total")}</td>
                      
                      <td>
                        <g:if test="${pagamentoInstance?.pago}">
                          <span class="label label-success">
                            ${message(code: 'default.boolean.true', default: 'Sim')}
                          </span>
                        </g:if>
                        <g:else>
                          <span class="label label-important">
                            ${message(code: 'default.boolean.false', default: 'Sim')}
                          </span>
                        </g:else>
                      </td>
                    </tr>
                  </g:each>
                  </tbody>
			    </table>
			    
			    <div class="pagination" align="center">
                    <g:paginate total="${pagamentosTotal}" />
                </div>
			    
			</div>
		</div>
	</body>
</html>
